﻿<%@ Page Title="PersonInsert" Language="C#" MasterPageFile="~/Site.Master" CodeBehind="Insert.aspx.cs" Inherits="SMBCFamilyAssessment.Models.Persons.Insert" %>
<asp:Content runat="server" ContentPlaceHolderID="MainContent">
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    
      <div>

          <asp:Label ID="Label1" runat="server"></asp:Label>
       <h2>Search Property</h2>

   

          <telerik:RadSearchBox ID="RadSearchBox1" runat="server" DataSourceID="ObjectDataSource1" Filter="StartsWith"
        OnSearch="RadSearchBox1_Search"  DataKeyNames="PropertyaddressId" 
           Width="300px" DropDownSettings-Height="300" Skin="BlackMetroTouch">
        <DropDownSettings Width="460"></DropDownSettings>
                     <WebServiceSettings Path="Insert.aspx" Method="GetData" />
          </telerik:RadSearchBox>
    
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetPropertyAddressData" TypeName="SMBCFamilyAssessment.Logic.AssessmentBLcs">
        <SelectParameters>
            <asp:Parameter Name="s" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
       </div>
          
        <div>
		<p>&nbsp;</p>
        <asp:FormView  ID="FormView1" runat="server"
            ItemType="SMBCFamilyAssessment.Models.Person" DefaultMode="Insert"
            InsertItemPosition="FirstItem" InsertMethod="InsertItem"
            OnItemCommand="ItemCommand" RenderOuterTable="false">
            <InsertItemTemplate>
                <fieldset class="form-horizontal">
				<legend>Insert Person</legend>
		        <asp:ValidationSummary runat="server" CssClass="alert alert-danger" />
					<%--		<asp:DynamicControl Mode="Insert" 
								DataField="FamilyId" 
								DataTypeName="SMBCFamilyAssessment.Models.Family" 
								DataTextField="Address1" 
								DataValueField="FamilyId" 
								UIHint="ForeignKey" runat="server" />--%>
                            <asp:TextBox ID="TextBoxPropertyId" runat="server" Visible="true"></asp:TextBox>
                             <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Display="Dynamic" runat="server" 
                                 ControlToValidate="TextBoxPropertyId" ErrorMessage="Please choose property address"> </asp:RequiredFieldValidator>
						    <asp:DynamicControl Mode="Insert" DataField="FirstName" runat="server" />
						    <asp:DynamicControl Mode="Insert" DataField="LastName" runat="server" />
						    <asp:DynamicControl Mode="Insert" DataField="DOB" runat="server" />
						    <asp:DynamicControl Mode="Insert" DataField="Notes" runat="server" />
						    <asp:DynamicControl Mode="Insert" DataField="EndedDateTime" runat="server" />
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <asp:Button runat="server" ID="InsertButton" CommandName="Insert" Text="Insert" CssClass="btn btn-primary" />
                            <asp:Button runat="server" ID="CancelButton" CommandName="Cancel" Text="Cancel" CausesValidation="false" CssClass="btn btn-default" />
                        </div>
					</div>
                </fieldset>
            </InsertItemTemplate>
        </asp:FormView>
    </div>
</asp:Content>
